<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="jquery-3.1.0.min.js"></script>
    <script src="jquery-ui-1.12.0/jquery-ui.js"></script>
    <link rel="stylesheet" href="jquery-ui-1.12.0/jquery-ui.css"/>
    <script>
        $(function(){
            $("#div").progressbar({value:50});
        });
    </script>
</head>
<body>
   <div id="div"></div>

    <script>
            var pb;
            var max=100;
            var current=0;
            $(document).ready(function(){
                pb=$("#div");
                pb.progressbar({max:100});
                setInterval(changepb,100);
            });

            function changepb(){
                current++;
                if(current>=100){
                    current=0;
                }
                pb.progressbar("option","value",current);
            }
    </script>
</body>
</html>

